
<?php
class Game extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}

	/**function for viewing profiles
	 * @param id: the ID# of the game to view*/
	function show($id) {
		//load from the database
		$this->load->model('game_model');
		
		//if($this->game_model->replay_exists($id))
		$params['game_model'] = &$this->game_model;
			
		$game_set_data = $this->game_model->get_challenge_id($id);
		$game_data_array = $this->game_model->get_game($id);
			
		$params['subview'] = 'subview/game_view';
		
		$params['game_set_data'] = $game_set_data;
		$params['game_data_array'] = $game_data_array;

				
		//load view
		$this->load->view('homepage_view', $params);

	}
	
	/**
	 * Content downloader for replay data
	 * */
	function download($id){
		$this->load->model('game_model');
		$this->game_model->download_replay($id);
		
	
	}
	
}